import request from '@/utils/request'

export function getBulletin() {
    return request({
        url: `/agency/sys/bulletin/`,
        method: 'get',

    })
}

export function getAgencyList(params) {
    return request({
        url: '/agency/account/',
        method: 'get',
        params
    })
}

export function saveAgency(data) {
    return request({
        url: `/agency/account/`,
        method: 'post',
        data
    })
}

export function getMerchantsList(params) {
  return request({
    url: '/mch/',
    method: 'get',
    params
  })
}

export function getReportList(params) {
  return request({
    url: '/agency/get_agency_stats_report/',
    method: 'get',
    params
  })
}

export function saveBlackList(data) {
    return request({
        url: `/agency/blacklist/`,
        method: 'post',
        data
    })
}

export function deleteBlackList(id) {
    return request({
        url: `/agency/blacklist/${id}/`,
        method: 'DELETE',
    })
}

export function getAgencyDetail(id) {
    return request({
        url: `/agency/account/${id}/`,
        method: 'get'
    })
}

export function deleteAgency(id) {
    return request({
        url: `/agency/account/${id}/`,
        method: 'delete'
    })
}

export function updateAgency(data, id) {
    return request({
        url: `/agency/account/${id}/`,
        method: 'put',
        data
    })
}

export function getBlackList(params) {
    return request({
        url: '/agency/blacklist/',
        method: 'get',
        params
    })
}

export function getReceiptReportList(params) {
    return request({
        url: '/agency/receipt_report/',
        method: 'get',
        params
    })
}

export function getDailyReceiptReportList(params) {
    return request({
        url: '/agency/agency_daily_report/',
        method: 'get',
        params
    })
}

export function getAgencyReceiptList(params) {
    return request({
        url: '/agency/receipt_addresses/',
        method: 'get',
        params
    })
}

export function saveAgencyReceipt(data) {
    return request({
        url: `/agency/receipt_addresses/`,
        method: 'post',
        data
    })
}

export function getAgencyReceiptDetail(id) {
    return request({
        url: `/agency/receipt_addresses/${id}/`,
        method: 'get'
    })
}

export function deleteAgencyReceipt(id) {
    return request({
        url: `/agency/receipt_addresses/${id}/`,
        method: 'delete'
    })
}

export function disabledAgencyReceipt(data, id) {
    return request({
        url: `/agency/receipt_addresses/${id}/status/`,
        method: 'put',
        data
    })
}

export function updateAgencyReceipt(data, id) {
    return request({
        url: `/agency/receipt_addresses/${id}/`,
        method: 'put',
        data
    })
}

export function getAgencyRechargeList(params) {
    return request({
        url: '/agency/my_recharge/',
        method: 'get',
        params
    })
}

export function saveAgencyRecharge(data) {
    return request({
        url: `/agency/my_recharge/`,
        method: 'post',
        data
    })
}

export function agreeAgencyRecharge(id, data) {
    return request({
        url: `/agency/recharge_order/${id}/agree/ `,
        method: 'put',
        data
    })
}

export function refuseAgencyRecharge(id, data) {
    return request({
        url: `/agency/recharge_order/${id}/refuse/ `,
        method: 'put',
        data
    })
}


export function chaseAgencyRecharge(id, data) {
    return request({
        url: `agency/recharge_order/${id}/chase/`,
        method: 'put',
        data
    })
}


export function getAgencyChildRechargeList(params) {
    return request({
        url: '/agency/apply_recharge/',
        method: 'get',
        params
    })
}

export function getQiniuUploadToken() {
    return request({
        url: '/utils/get_upload_token/',
        method: 'get',
    })
}

export function qiniuUpload(data) {
    return request({
        url: `http://up-z1.qiniup.com/`,
        method: 'post',
        data
    })
}

export function getAgencyInfo(params) {
    return request({
        url: '/agency/info/',
        method: 'get',
        params
    })
}

export function enbleAgentMag(id) {
    return request({
        url: `/agency/account/${id}/enable/ `,
        method: 'put'
    })
}

export function openAgentMag(id) {
    return request({
        url: `/agency/account/${id}/disable/ `,
        method: 'put'
    })
}

export function getRankConf() {
    return request({
        url: `/agency/rank_conf/ `,
        method: 'get'
    })
}

export function updateAgencyMenber(data) {
    return request({
        url: `/agency/info/`,
        method: 'put',
        data
    })
}

//添加玩家订单
export function addUserOrder(data) {
    return request({
        url: '/recharge_orders/',
        method: 'post',
        data
    })
}

//获取充值订单列表
export function getOrderList(id) {
    return request({
        ule: `/recharge_orders/${id}/`,
        method: 'get'
    })
}

//取消订单列表
export function cancelOrder(id, data) {
    return request({
        url: `/recharge_orders/${id}/cancel/`,
        method: 'put',
        data
    })

}

//转账申请
export function sendRecharge(id,data) {
    return request({
        url: `/recharge_orders/${id}/commit/`,
        method: 'put',
        data
    })
}

//追分
export function sendRechargeOrderschase(id, data) {
    return request({
        url: `/recharge_orders/${id}/chase/`,
        method: 'put',
        data
    })
}

//查询订单详情
export function getOrderInfoByID(id) {
    return request({
        url: `/recharge_orders/${id}/ `,
        method: 'get'
    })

}

export function getOrderList1(params) {
    return request({
        url: `/recharge_orders/`,
        method: 'get',
        params
    })
}

export function gotoWork() {
    return request({
        url: `/agency/go_to_work/`,
        method: 'post',
    })
}

export function gooffWork() {
    return request({
        url: `/agency/go_off_work/`,
        method: 'post',
    })
}

//获取收款账号列表
export function getReceipts() {
    return request({
        url: `/agency/receipt_conf/`,
        method: 'get',
    })

}

//修改密码
export function resetMyPassword(data) {
    return request({
        url: '/agency/reset_my_password/',
        method: 'post',
        data
    })
}

//重置密码
export function resetPassword(id) {
    return request({
        url: `/agency/reset_password/${id}/`,
        method: 'post'
    })
}

//获取收款账号列表
export function getReceiptAddresses(params) {
    return request({
        url: `/agency/receipt_addresses/`,
        method: 'get',
        params
    })
}

//获取收款账号详情
export function getReceiptAddressByID(id) {
    return request({
        url: `/agency/receipt_addresses/${id}`,
        method: 'get'
    })
}

//总代审核子代订单通过
export function agreeOrder(id) {
    return request({
        url:`/recharge_orders/review/${id}/agree/`,
        method:'put'
    })
}

//总代审核子代订单拒绝
export function refuseOrder(id) {
    return request({
        url:`/recharge_orders/review/${id}/refuse/`,
        method:'put'
    })
}

//获取快捷回复列表
export function getQuickReplyList() {
  return request({
    url:'agency/quick_reply/',
    method:'get'
  })
}


//新增快捷回复
export function addQuickReply(data) {
  return request({
    url:'agency/quick_reply/',
    method:'POST',
    data
  })
}

//通过ID编辑快捷回复
export function updateQuickReply(id,data) {
  return request({
    url:`agency/quick_reply/${id}/`,
    method:'put',
    data
  })
}

//通过ID删除快捷回复
export function deleteQuickReplyById(id) {
  return request({
    url:`agency/quick_reply/${id}/`,
    method:'delete'
  })
}

//获取订单评价
export function getOrderEvaluation(params) {
  return request({
    url: '/recharge_orders/comment/',
    method: 'get',
    params
  })
}

export function exportExel(id) {
  return request({
    url:`/sys/export_task/${id}/`,
    method:'get'
  })
}

//获取投诉列表
export function getComplaintList(params) {
  return request({
    url: '/agency/complain/',
    method: 'get',
    params
  })
}

//通过ID获取投诉详情
export function getComplainById(id) {
  return request({
    url: `/agency/complain/${id}/`,
    method: 'get'
  })
}

//通过ID回复投诉
export function replyComplainById(id, data) {
  return request({
    url: `/agency/complain/handle/${id}/`,
    method: 'put',
    data
  })
}

//聊天相关-获取聊天信息
export function getChatInfo(params) {
  return request({
    url: '/im/topics/',
    method: 'get',
    params
  })
}
//获取聊天记录
export function getIMInfoByTopicId(topicId) {
  return request({
    url: `/im/topics/${topicId}/messages/`,
    method: 'get'
  })
}

export function getImInfoByLastInfoId(topicId, params) {
  return request({
    url: `/im/topics/${topicId}/messages/`,
    method: 'get',
    params
  })
}

export function getImTopic(params) {
  return request({
    url:`im/topics/messages/`,
    method:'get',
    params
  })
}